[Autocomplete] support reset on focus#3422
Conversation
📊 Packages dist files size differenceThanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
|
||||||||||||
5a89168 to
814ab69
Compare
|
Thanks for the clarification on the default functionality and I agree that an additional option here is the best solution. I do want to clarify that it's not just on "focus" or "change" events, it's when the reset This question to ask, I suppose, is, "Should the default value for reset_on_focus be |
Kocal
left a comment
There was a problem hiding this comment.
Since it's not really a bug but a feature, can you add a new changelog entry for 2.35 please?
Thanks!
| (this.tomSelect as any).loadedSearches = {}; | ||
| if (typeof (this.tomSelect as any).clearPagination === 'function') { | ||
| (this.tomSelect as any).clearPagination(); | ||
| } |
There was a problem hiding this comment.
Please remove the as any, it's often a bad practice, and it does not make sense here AFAIK.
There was a problem hiding this comment.
yes, i just pushed an update for this part
cd3c6f5 to
bfe0a77
Compare
It’s not actually a bug, but the default behavior of Tom Select.
When the preload option is set to focus (which is the default), it fetches the data once and then reuses the cache to avoid triggering a request every time the select is opened.
With this PR, a new option is introduced to let you control whether the state should be reset on focus or not.